﻿using System.Collections.Generic;
using Gp.Scripts.Equip;
using Gp.Scripts.Core;
using Sirenix.OdinInspector;

using UnityEngine;

namespace Gp.Scripts.Data {
    public abstract class EquipmentEntityConfig : BaseEntityConfigObject {
        protected const string BasicGroupId = "数据/status/基础";
        [HideLabel]
        [HorizontalGroup("数据"), VerticalGroup("数据/preview")]
        [PreviewField(100, ObjectFieldAlignment.Center)]
        [PropertyOrder(-99)]
        public Sprite icon;

        [VerticalGroup("数据/preview"), HideLabel]
        public string itemName = "New Equip";

        [TextArea(10, 30)] [VerticalGroup("数据/preview")] [LabelText("装备描述"), Space(5)]
        public string description = "this is a new equipment";
        
        
        
        
        [LabelText("装备要求")]
        [Tooltip("不满足条件无法装备")]
        [VerticalGroup("数据/status")]
        [Title("基础配置")]
        [BoxGroup(BasicGroupId, false, order: 999)]
        public List<EquipRequireItem> requires;

        
        [LabelText("属性增益")]
        [BoxGroup(BasicGroupId)]
        [SerializeField]
        protected List<BonusNumber> bonus = new ();

        
        [LabelText("额外Buff")]
        [BoxGroup(BasicGroupId)]
        public List<BuffEntityConfig> buffs = new();

        
        
        public override string ItemName { get => this.itemName; set => this.itemName = value; }
        public override string Description { get => this.description; set => this.description = value; }
        public override Sprite Icon { get => this.icon; set => this.icon = value; }
        

        public IEnumerable<BonusNumber> Bonus() {
            return this.bonus;
        }
    }
}